<template>
  <div><input type="text" @keyup.enter="add" v-model="text" /><button>提交</button></div>
</template>

<script>
import bus from "@/assets/Bus.js";
export default {
  name: "",
  data() {
    return {
      text: "",
    };
  },
  mounted() {},
  methods: {
    add() {
      if (this.text == "") {
        //提示判断输入为空时的提示信息
        confirm("输入不能为空！");
      } else {
        this.$store.commit("zms_wwc", this.text);
        this.text = "";
      }
      bus.$emit("num", "1");
    },
  },
  computed: {},
  watch: {},
};
</script>

<style scoped>
div {
  display: flex;
  justify-content: space-evenly;
  margin-bottom: 15px;
}
</style>
